package com.elitesland.system.repo;

import com.elitesland.system.entity.SysUserRoleDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

/**
 * <pre>
 *     用户角色关联查询处理
 * </pre>
 * @author mir
 * @date 2020-09-28
 */
@Repository
public interface SysUserRoleRepo extends JpaRepository<SysUserRoleDO, Long>, QuerydslPredicateExecutor<SysUserRoleDO> {

    @Transactional
    void deleteAllByUserIdIn(List<Long> userIds);

    @Transactional
    void deleteAllByRoleIdIn(List<Long> roleIds);

    @Transactional
    void deleteAllByIdIn(List<Long> ids);
}
